package com.ccdt.tv.smartrecommend.view.bean;

import android.text.TextUtils;

import com.ccdt.tv.smartrecommend.utils.CheckUtils;

/**
 * Created by wudz on 2017/7/19.
 */

public abstract class BaseEventBean extends BaseBean{
    private static final String TAG="BaseEventBean";
    private String srcViewId; //事件触发源对象id
    private String srcMethodName; //事件触发源方法名称
    private static int privateEventIdCount = 0;
    public BaseEventBean(String eventId,String srcViewId,String srcMethodName)
    {
        super(eventId);
        if(TextUtils.isEmpty(eventId))
        {
            setId("eventId:" + Integer.toString(privateEventIdCount++));
        }

        this.srcViewId=srcViewId;
        this.srcMethodName=srcMethodName;
    }
    public String getEventId() {
        return getId();
    }

    public String getSrcViewId() {
        return srcViewId;
    }

    public String getSrcMethodName() {
        return srcMethodName;
    }

    @Override
    public String toString() {
        return "BaseEventBean{" +
                ", srcViewId='" + srcViewId + '\'' +
                ", srcMethodName='" + srcMethodName + '\'' +
                '}'+super.toString();
    }

    @Override
    public void check() {
        super.check();
        CheckUtils.checkNonNullString(srcViewId,"",true,"srcViewId is error!");
        CheckUtils.checkNonNullString(srcMethodName,"",true,"srcMethodName is error!");
    }
}
